
import org.apache.shiro.crypto.hash.Sha512Hash

import grails.util.GrailsUtil


import org.icress.fusion.shiro.*
import org.icress.fusion.admin.*
import org.icress.fusion.b2b.*
import org.icress.fusion.wf.*
import org.icress.fusion.ws.*

class aBootStrap {
    
    def grailsApplication

    def init = { servletContext ->
        switch(GrailsUtil.environment) {
            case "development":
                configureForDevelopment()
                break
            case "production":
                break
        }
    }
    def configureForDevelopment = {
        /*init profile*/
        def adminProfile = new Profile(name:"Admin Profile").save(flush:true)
        def dealerProfile = new Profile(name:"Dealer Profile").save(flush:true)
        def deptProfile = new Profile(name:"Department Profile").save(flush:true)

        /*init page layout*/
        def recordType220 = new RecordType(serialNumber :'220', name:'客户订单', domain:'salesOrder', description:'', isActive:true).save(flush:true)
        def recordType221 = new RecordType(serialNumber :'221', name:'特价订单', domain:'salesOrder', description:'', isActive:true).save(flush:true)
        def recordType224 = new RecordType(serialNumber :'224', name:'项目订单', domain:'salesOrder', description:'', isActive:true).save(flush:true)
 
         
        new PageLayout(name:"dealer_220", domain : "salesOrder", recordType :recordType220, profile:adminProfile).save(flush:true)
        new PageLayout(name:"dealer_220", domain : "salesOrder", recordType :recordType220, profile:dealerProfile).save(flush:true)
        new PageLayout(name:"dealer_220", domain : "salesOrder", recordType :recordType220, profile:deptProfile).save(flush:true)
        
        new PageLayout(name:"dealer_221", domain : "salesOrder", recordType :recordType221, profile:adminProfile).save(flush:true)
        new PageLayout(name:"dealer_221", domain : "salesOrder", recordType :recordType221, profile:dealerProfile).save(flush:true)
        new PageLayout(name:"dealer_221", domain : "salesOrder", recordType :recordType221, profile:deptProfile).save(flush:true)

        new PageLayout(name:"dealer_224", domain : "salesOrder", recordType :recordType224, profile:adminProfile).save(flush:true)
        new PageLayout(name:"dealer_224", domain : "salesOrder", recordType :recordType224, profile:dealerProfile).save(flush:true)
        new PageLayout(name:"dealer_224", domain : "salesOrder", recordType :recordType224, profile:deptProfile).save(flush:true)

        
        //create user
        def adminUser = new User(username: "admin",  passwordHash: new Sha512Hash("admin").toHex(), profile:adminProfile).save(flush:true)
        //create role
        def roleAdmin = new Role(name:"Admin Role")
            .addToPermissions("*:*")
            .addToUsers(adminUser)
            .save(flush:true)
            
        /*init department*/
        def dept3002 = new Department(serialNumber:3002  ,name:'商务部', type : 'C', parentDept : null, description:'L1',isActive:true).save(flush:true)
        
        def dept3200 = new Department(serialNumber:3200  ,name:'华南大区', type : 'R', parentDept : dept3002, description:'',isActive:true).save(flush:true)
        def dept3210 = new Department(serialNumber:3210  ,name:'广州办事处', type : 'B', parentDept : dept3200, description:'',isActive:true).save(flush:true)
        def dept3220 = new Department(serialNumber:3220  ,name:'东莞办事处', type : 'B', parentDept : dept3200, description:'',isActive:true).save(flush:true)
        def dept3230 = new Department(serialNumber:3230  ,name:'中山办事处', type : 'B', parentDept : dept3200, description:'',isActive:true).save(flush:true)
        def dept3240 = new Department(serialNumber:3240  ,name:'福州办事处', type : 'B', parentDept : dept3200, description:'',isActive:true).save(flush:true)
        def dept3250 = new Department(serialNumber:3250  ,name:'深圳建筑办事处', type : 'B', parentDept : dept3200, description:'',isActive:true).save(flush:true)
        def dept3260 = new Department(serialNumber:3260  ,name:'南宁办事处', type : 'B', parentDept : dept3200, description:'',isActive:true).save(flush:true)
        
        def dept3300 = new Department(serialNumber:3300  ,name:'华东大区', type : 'R', parentDept : dept3002, description:'',isActive:true).save(flush:true)
        def dept3310 = new Department(serialNumber:3310  ,name:'上海工控办事处', type : 'B', parentDept : dept3300, description:'',isActive:true).save(flush:true)
        def dept3320 = new Department(serialNumber:3320  ,name:'上海建筑办事处', type : 'B', parentDept : dept3300, description:'',isActive:true).save(flush:true)
        def dept3330 = new Department(serialNumber:3330  ,name:'杭州办事处', type : 'B', parentDept : dept3300, description:'',isActive:true).save(flush:true)
        def dept3340 = new Department(serialNumber:3340  ,name:'上海电力办事处', type : 'B', parentDept : dept3300, description:'',isActive:true).save(flush:true)
        def dept3350 = new Department(serialNumber:3350  ,name:'长沙办事处', type : 'B', parentDept : dept3300, description:'',isActive:true).save(flush:true)
        def dept3360 = new Department(serialNumber:3360  ,name:'南昌办事处', type : 'B', parentDept : dept3300, description:'',isActive:true).save(flush:true)
        
        def dept3400 = new Department(serialNumber:3400  ,name:'华中大区', type : 'R', parentDept : dept3002, description:'',isActive:true).save(flush:true)
        def dept3410 = new Department(serialNumber:3410  ,name:'南京办事处', type : 'B', parentDept : dept3400, description:'',isActive:true).save(flush:true)
        def dept3420 = new Department(serialNumber:3420  ,name:'苏州办事处', type : 'B', parentDept : dept3400, description:'',isActive:true).save(flush:true)
        def dept3430 = new Department(serialNumber:3430  ,name:'郑州办事处', type : 'B', parentDept : dept3400, description:'',isActive:true).save(flush:true)
        def dept3440 = new Department(serialNumber:3440  ,name:'武汉办事处', type : 'B', parentDept : dept3400, description:'',isActive:true).save(flush:true)
        def dept3450 = new Department(serialNumber:3450  ,name:'合肥办事处', type : 'B', parentDept : dept3400, description:'',isActive:true).save(flush:true)
        def dept3460 = new Department(serialNumber:3460  ,name:'徐州办事处', type : 'B', parentDept : dept3400, description:'',isActive:true).save(flush:true)
        
        def dept3500 = new Department(serialNumber:3500  ,name:'华北大区', type : 'R', parentDept : dept3002, description:'',isActive:true).save(flush:true)
        def dept3510 = new Department(serialNumber:3510  ,name:'北京办事处', type : 'B', parentDept : dept3500,description:'', isActive:true).save(flush:true)
        def dept3520 = new Department(serialNumber:3520  ,name:'天津办事处', type : 'B', parentDept : dept3500,description:'', isActive:true).save(flush:true)
        def dept3530 = new Department(serialNumber:3530  ,name:'济南办事处', type : 'B', parentDept : dept3500,description:'', isActive:true).save(flush:true)
        def dept3540 = new Department(serialNumber:3540  ,name:'石家庄办事处', type : 'B', parentDept : dept3500,description:'', isActive:true).save(flush:true)
        def dept3550 = new Department(serialNumber:3550  ,name:'太原办事处', type : 'B', parentDept : dept3500, description:'',isActive:true).save(flush:true)
        def dept3560 = new Department(serialNumber:3560  ,name:'呼和浩特办事处', type : 'B', parentDept : dept3500, description:'',isActive:true).save(flush:true)
        
        def dept3600 = new Department(serialNumber:3600  ,name:'东北大区', type : 'R', parentDept : dept3002, description:'',isActive:true).save(flush:true)
        def dept3610 = new Department(serialNumber:3610  ,name:'沈阳办事处', type : 'B', parentDept : dept3600, description:'',isActive:true).save(flush:true)
        def dept3620 = new Department(serialNumber:3620  ,name:'哈尔滨办事处', type : 'B', parentDept : dept3600, description:'',isActive:true).save(flush:true)
        def dept3630 = new Department(serialNumber:3630  ,name:'长春办事处', type : 'B', parentDept : dept3600, description:'',isActive:true).save(flush:true)
        def dept3640 = new Department(serialNumber:3640  ,name:'大连办事处', type : 'B', parentDept : dept3600, description:'',isActive:true).save(flush:true)
        
        def dept3700 = new Department(serialNumber:3700  ,name:'西南大区', type : 'R', parentDept : dept3002, description:'',isActive:true).save(flush:true)
        def dept3710 = new Department(serialNumber:3710  ,name:'重庆办事处', type : 'B', parentDept : dept3700, description:'',isActive:true).save(flush:true)
        def dept3720 = new Department(serialNumber:3720  ,name:'成都办事处', type : 'B', parentDept : dept3700, description:'',isActive:true).save(flush:true)
        def dept3730 = new Department(serialNumber:3730  ,name:'西安办事处', type : 'B', parentDept : dept3700, description:'',isActive:true).save(flush:true)
        def dept3740 = new Department(serialNumber:3740  ,name:'贵阳办事处', type : 'B', parentDept : dept3700, description:'',isActive:true).save(flush:true)
        def dept3750 = new Department(serialNumber:3750  ,name:'昆明办事处', type : 'B', parentDept : dept3700, description:'',isActive:true).save(flush:true)
        
        def dept3800 = new Department(serialNumber:3800  ,name:'深圳大区', type : 'R', parentDept : dept3002, description:'',isActive:true).save(flush:true)
        def dept3810 = new Department(serialNumber:3810  ,name:'深圳一办', type : 'B', parentDept : dept3800, description:'',isActive:true).save(flush:true)
        def dept3820 = new Department(serialNumber:3820  ,name:'深圳二办', type : 'B', parentDept : dept3800, description:'',isActive:true).save(flush:true)
        def dept3830 = new Department(serialNumber:3830  ,name:'深圳工控办事处', type : 'B', parentDept : dept3800, description:'',isActive:true).save(flush:true)

		/*group member*/
        
        def user3002_1 = new User(username: "3002_1",  passwordHash: new Sha512Hash("3002_1").toHex(), profile:deptProfile, department : dept3002).save(flush:true)
        def user3200_1 = new User(username: "3200_1",  passwordHash: new Sha512Hash("3200_1").toHex(), profile:deptProfile, department : dept3200).save(flush:true)
        def user3210_1 = new User(username: "3210_1",  passwordHash: new Sha512Hash("3210_1").toHex(), profile:deptProfile, department : dept3210).save(flush:true)
        def user3220_1 = new User(username: "3220_1",  passwordHash: new Sha512Hash("3220_1").toHex(), profile:deptProfile, department : dept3220).save(flush:true)
        def user3230_1 = new User(username: "3230_1",  passwordHash: new Sha512Hash("3230_1").toHex(), profile:deptProfile, department : dept3230).save(flush:true)
        def user3240_1 = new User(username: "3240_1",  passwordHash: new Sha512Hash("3240_1").toHex(), profile:deptProfile, department : dept3240).save(flush:true)
        def user3250_1 = new User(username: "3250_1",  passwordHash: new Sha512Hash("3250_1").toHex(), profile:deptProfile, department : dept3250).save(flush:true)
        def user3260_1 = new User(username: "3260_1",  passwordHash: new Sha512Hash("3260_1").toHex(), profile:deptProfile, department : dept3260).save(flush:true)
        def user3300_1 = new User(username: "3300_1",  passwordHash: new Sha512Hash("3300_1").toHex(), profile:deptProfile, department : dept3300).save(flush:true)
        def user3310_1 = new User(username: "3310_1",  passwordHash: new Sha512Hash("3310_1").toHex(), profile:deptProfile, department : dept3310).save(flush:true)
        def user3320_1 = new User(username: "3320_1",  passwordHash: new Sha512Hash("3320_1").toHex(), profile:deptProfile, department : dept3320).save(flush:true)
        def user3330_1 = new User(username: "3330_1",  passwordHash: new Sha512Hash("3330_1").toHex(), profile:deptProfile, department : dept3330).save(flush:true)
        def user3340_1 = new User(username: "3340_1",  passwordHash: new Sha512Hash("3340_1").toHex(), profile:deptProfile, department : dept3340).save(flush:true)
        def user3350_1 = new User(username: "3350_1",  passwordHash: new Sha512Hash("3350_1").toHex(), profile:deptProfile, department : dept3350).save(flush:true)
        def user3360_1 = new User(username: "3360_1",  passwordHash: new Sha512Hash("3360_1").toHex(), profile:deptProfile, department : dept3360).save(flush:true)
        def user3400_1 = new User(username: "3400_1",  passwordHash: new Sha512Hash("3400_1").toHex(), profile:deptProfile, department : dept3400).save(flush:true)
        def user3410_1 = new User(username: "3410_1",  passwordHash: new Sha512Hash("3410_1").toHex(), profile:deptProfile, department : dept3410).save(flush:true)
        def user3420_1 = new User(username: "3420_1",  passwordHash: new Sha512Hash("3420_1").toHex(), profile:deptProfile, department : dept3420).save(flush:true)
        def user3430_1 = new User(username: "3430_1",  passwordHash: new Sha512Hash("3430_1").toHex(), profile:deptProfile, department : dept3430).save(flush:true)
        def user3440_1 = new User(username: "3440_1",  passwordHash: new Sha512Hash("3440_1").toHex(), profile:deptProfile, department : dept3440).save(flush:true)
        def user3450_1 = new User(username: "3450_1",  passwordHash: new Sha512Hash("3450_1").toHex(), profile:deptProfile, department : dept3450).save(flush:true)
        def user3460_1 = new User(username: "3460_1",  passwordHash: new Sha512Hash("3460_1").toHex(), profile:deptProfile, department : dept3460).save(flush:true)
        def user3500_1 = new User(username: "3500_1",  passwordHash: new Sha512Hash("3500_1").toHex(), profile:deptProfile, department : dept3500).save(flush:true)
        def user3510_1 = new User(username: "3510_1",  passwordHash: new Sha512Hash("3510_1").toHex(), profile:deptProfile, department : dept3510).save(flush:true)
        def user3520_1 = new User(username: "3520_1",  passwordHash: new Sha512Hash("3520_1").toHex(), profile:deptProfile, department : dept3520).save(flush:true)
        def user3530_1 = new User(username: "3530_1",  passwordHash: new Sha512Hash("3530_1").toHex(), profile:deptProfile, department : dept3530).save(flush:true)
        def user3540_1 = new User(username: "3540_1",  passwordHash: new Sha512Hash("3540_1").toHex(), profile:deptProfile, department : dept3540).save(flush:true)
        def user3550_1 = new User(username: "3550_1",  passwordHash: new Sha512Hash("3550_1").toHex(), profile:deptProfile, department : dept3550).save(flush:true)
        def user3560_1 = new User(username: "3560_1",  passwordHash: new Sha512Hash("3560_1").toHex(), profile:deptProfile, department : dept3560).save(flush:true)
        def user3600_1 = new User(username: "3600_1",  passwordHash: new Sha512Hash("3600_1").toHex(), profile:deptProfile, department : dept3600).save(flush:true)
        def user3610_1 = new User(username: "3610_1",  passwordHash: new Sha512Hash("3610_1").toHex(), profile:deptProfile, department : dept3610).save(flush:true)
        def user3620_1 = new User(username: "3620_1",  passwordHash: new Sha512Hash("3620_1").toHex(), profile:deptProfile, department : dept3620).save(flush:true)
        def user3630_1 = new User(username: "3630_1",  passwordHash: new Sha512Hash("3630_1").toHex(), profile:deptProfile, department : dept3630).save(flush:true)
        def user3640_1 = new User(username: "3640_1",  passwordHash: new Sha512Hash("3640_1").toHex(), profile:deptProfile, department : dept3640).save(flush:true)
        def user3700_1 = new User(username: "3700_1",  passwordHash: new Sha512Hash("3700_1").toHex(), profile:deptProfile, department : dept3700).save(flush:true)
        def user3710_1 = new User(username: "3710_1",  passwordHash: new Sha512Hash("3710_1").toHex(), profile:deptProfile, department : dept3710).save(flush:true)
        def user3720_1 = new User(username: "3720_1",  passwordHash: new Sha512Hash("3720_1").toHex(), profile:deptProfile, department : dept3720).save(flush:true)
        def user3730_1 = new User(username: "3730_1",  passwordHash: new Sha512Hash("3730_1").toHex(), profile:deptProfile, department : dept3730).save(flush:true)
        def user3740_1 = new User(username: "3740_1",  passwordHash: new Sha512Hash("3740_1").toHex(), profile:deptProfile, department : dept3740).save(flush:true)
        def user3750_1 = new User(username: "3750_1",  passwordHash: new Sha512Hash("3750_1").toHex(), profile:deptProfile, department : dept3750).save(flush:true)
        def user3800_1 = new User(username: "3800_1",  passwordHash: new Sha512Hash("3800_1").toHex(), profile:deptProfile, department : dept3800).save(flush:true)
        def user3810_1 = new User(username: "3810_1",  passwordHash: new Sha512Hash("3810_1").toHex(), profile:deptProfile, department : dept3810).save(flush:true)
        def user3820_1 = new User(username: "3820_1",  passwordHash: new Sha512Hash("3820_1").toHex(), profile:deptProfile, department : dept3820).save(flush:true)
        def user3830_1 = new User(username: "3830_1",  passwordHash: new Sha512Hash("3830_1").toHex(), profile:deptProfile, department : dept3830).save(flush:true)

        def roleDepartment = new Role(name:"Department Role[Approval]")
	        .addToPermissions("index:*")
	        .addToPermissions("nav:*")
	        .addToPermissions("auth:*")
            .addToPermissions("welcome:*")

	        .addToPermissions("contract:index")
	        .addToPermissions("contract:list")
	        .addToPermissions("contract:show")

	        .addToPermissions("salesOrder:index")
	        .addToPermissions("salesOrder:list")
	        .addToPermissions("salesOrder:show")
	        .addToPermissions("workflowApproval:confirm")
	        .addToPermissions("workflowApproval:approval")
	        .addToPermissions("salesOrderAjax:workflowHistory")
            .addToPermissions("salesOrderAjax:outBoundMessage")

            .addToPermissions("report:run")
            .addToPermissions("report:view")

            .addToPermissions("outBound:index")
            .addToPermissions("outBound:list")
            .addToPermissions("outBound:show")
            .addToPermissions("outBound:resurrect")
            .addToPermissions("outBound:showXml")

            .addToPermissions("creditControl:index")
            .addToPermissions("creditControl:list")
            .addToPermissions("creditControl:show")
            
	        .addToUsers(user3002_1)
	        .addToUsers(user3210_1)
	        .addToUsers(user3220_1)
	        .addToUsers(user3230_1)
	        .addToUsers(user3240_1)
	        .addToUsers(user3250_1)
	        .addToUsers(user3260_1)
	        .addToUsers(user3310_1)
	        .addToUsers(user3320_1)
	        .addToUsers(user3330_1)
	        .addToUsers(user3340_1)
	        .addToUsers(user3350_1)
	        .addToUsers(user3360_1)
	        .addToUsers(user3410_1)
	        .addToUsers(user3420_1)
	        .addToUsers(user3430_1)
	        .addToUsers(user3440_1)
	        .addToUsers(user3450_1)
	        .addToUsers(user3460_1)
	        .addToUsers(user3510_1)
	        .addToUsers(user3520_1)
	        .addToUsers(user3530_1)
	        .addToUsers(user3540_1)
	        .addToUsers(user3550_1)
	        .addToUsers(user3560_1)
	        .addToUsers(user3610_1)
	        .addToUsers(user3620_1)
	        .addToUsers(user3630_1)
	        .addToUsers(user3640_1)
	        .addToUsers(user3710_1)
	        .addToUsers(user3720_1)
	        .addToUsers(user3730_1)
	        .addToUsers(user3740_1)
            .addToUsers(user3750_1)
	        .addToUsers(user3810_1)
	        .addToUsers(user3820_1)
	        .addToUsers(user3830_1)
	        .save(flush:true)

        def roleDepartmentReadonly = new Role(name:"Department Role[Readonly]")
	        .addToPermissions("index:*")
	        .addToPermissions("nav:*")
	        .addToPermissions("auth:*")
            .addToPermissions("welcome:*")

	        .addToPermissions("contract:index")
	        .addToPermissions("contract:list")
	        .addToPermissions("contract:show")

	        .addToPermissions("salesOrder:index")
	        .addToPermissions("salesOrder:list")
	        .addToPermissions("salesOrder:show")
	        .addToPermissions("salesOrderAjax:workflowHistory")
            .addToPermissions("salesOrderAjax:outBoundMessage")

            .addToPermissions("report:run")
            .addToPermissions("report:view")

            .addToPermissions("outBound:index")
            .addToPermissions("outBound:list")
            .addToPermissions("outBound:show")
            .addToPermissions("outBound:showXml")

            .addToPermissions("creditControl:index")
            .addToPermissions("creditControl:list")
            .addToPermissions("creditControl:show")

	        .addToUsers(user3200_1)
	        .addToUsers(user3300_1)
	        .addToUsers(user3400_1)
	        .addToUsers(user3500_1)
	        .addToUsers(user3600_1)
	        .addToUsers(user3700_1)
	        .addToUsers(user3800_1)
	        .save(flush:true)


        /*staff*/
        def staff200 = new Staff(serialNumber : '200', name :'张巧云', department : dept3002).save(flush:true)
        def staff13082 = new Staff(serialNumber : '13082', name :'赵丹', department : dept3002).save(flush:true)
        def staff10115 = new Staff(serialNumber : '10115', name :'刘敏', department : dept3002).save(flush:true)
        def staff16115 = new Staff(serialNumber : '16115', name :'邹丽丝', department : dept3002).save(flush:true)
        def staff15611 = new Staff(serialNumber : '15611', name :'宋三霞', department : dept3002).save(flush:true)
        def staff16487 = new Staff(serialNumber : '16487', name :'刘静', department : dept3002).save(flush:true)
        def staff14253 = new Staff(serialNumber : '14253', name :'冯琪', department : dept3002).save(flush:true)
        def staff10107 = new Staff(serialNumber : '10107', name :'李想', department : dept3002).save(flush:true)
        def staff10320 = new Staff(serialNumber : '10320', name :'李瑞雪', department : dept3002).save(flush:true)
        def staff10403 = new Staff(serialNumber : '10403', name :'黄娟', department : dept3002).save(flush:true)
        def staff11078 = new Staff(serialNumber : '11078', name :'余启华', department : dept3002).save(flush:true)
        def staff10978 = new Staff(serialNumber : '10978', name :'李川', department : dept3200).save(flush:true)
        def staff10123 = new Staff(serialNumber : '10123', name :'宋金华', department : dept3210).save(flush:true)
        def staff11799 = new Staff(serialNumber : '11799', name :'熊新安', department : dept3210).save(flush:true)
        def staff11890 = new Staff(serialNumber : '11890', name :'胡杰', department : dept3210).save(flush:true)
        def staff13285 = new Staff(serialNumber : '13285', name :'张正涛', department : dept3210).save(flush:true)
        def staff15273 = new Staff(serialNumber : '15273', name :'丘段', department : dept3210).save(flush:true)
        def staff14714 = new Staff(serialNumber : '14714', name :'刘军政', department : dept3210).save(flush:true)
        def staff15449 = new Staff(serialNumber : '15449', name :'孙歌', department : dept3210).save(flush:true)
        def staff13073 = new Staff(serialNumber : '13073', name :'刘妙', department : dept3210).save(flush:true)
        def staff15595 = new Staff(serialNumber : '15595', name :'刘四海', department : dept3210).save(flush:true)
        def staff16402 = new Staff(serialNumber : '16402', name :'王非', department : dept3220).save(flush:true)
        def staff16252 = new Staff(serialNumber : '16252', name :'阳敏', department : dept3220).save(flush:true)
        def staff16493 = new Staff(serialNumber : '16493', name :'王磊', department : dept3220).save(flush:true)
        def staff16502 = new Staff(serialNumber : '16502', name :'刘华丽', department : dept3220).save(flush:true)
        def staff16506 = new Staff(serialNumber : '16506', name :'汪益双', department : dept3220).save(flush:true)
        def staff10706 = new Staff(serialNumber : '10706', name :'陈朱文', department : dept3220).save(flush:true)
        def staff14052 = new Staff(serialNumber : '14052', name :'岳智波', department : dept3220).save(flush:true)
        def staff10052 = new Staff(serialNumber : '10052', name :'董津', department : dept3230).save(flush:true)
        def staff16443 = new Staff(serialNumber : '16443', name :'王红霞', department : dept3230).save(flush:true)
        def staff14758 = new Staff(serialNumber : '14758', name :'刘冬明', department : dept3230).save(flush:true)
        def staff14444 = new Staff(serialNumber : '14444', name :'金涌泽', department : dept3240).save(flush:true)
        def staff15347 = new Staff(serialNumber : '15347', name :'邓远方', department : dept3240).save(flush:true)
        def staff14693 = new Staff(serialNumber : '14693', name :'蔡杨', department : dept3240).save(flush:true)
        def staff15455 = new Staff(serialNumber : '15455', name :'林雪丽', department : dept3240).save(flush:true)
        def staff16407 = new Staff(serialNumber : '16407', name :'林艳玲', department : dept3240).save(flush:true)
        def staff15124 = new Staff(serialNumber : '15124', name :'崔帅', department : dept3250).save(flush:true)
        def staff15094 = new Staff(serialNumber : '15094', name :'郝平', department : dept3250).save(flush:true)
        def staff13200 = new Staff(serialNumber : '13200', name :'李党生', department : dept3260).save(flush:true)
        def staff13202 = new Staff(serialNumber : '13202', name :'刘彪', department : dept3260).save(flush:true)
        def staff16483 = new Staff(serialNumber : '16483', name :'周莹', department : dept3260).save(flush:true)
        def staff15230 = new Staff(serialNumber : '15230', name :'丁晓飞', department : dept3310).save(flush:true)
        def staff14695 = new Staff(serialNumber : '14695', name :'吉鹏鹏', department : dept3310).save(flush:true)
        def staff14700 = new Staff(serialNumber : '14700', name :'黄旋', department : dept3310).save(flush:true)
        def staff15453 = new Staff(serialNumber : '15453', name :'张柳', department : dept3310).save(flush:true)
        def staff12419 = new Staff(serialNumber : '12419', name :'姜侃如', department : dept3310).save(flush:true)
        def staff10854 = new Staff(serialNumber : '10854', name :'王波', department : dept3310).save(flush:true)
        def staff10812 = new Staff(serialNumber : '10812', name :'邓轶', department : dept3310).save(flush:true)
        def staff16531 = new Staff(serialNumber : '16531', name :'李蒙蒙', department : dept3310).save(flush:true)
        def staff12444 = new Staff(serialNumber : '12444', name :'吴晗', department : dept3310).save(flush:true)
        def staff12431 = new Staff(serialNumber : '12431', name :'薛文科', department : dept3310).save(flush:true)
        def staff12453 = new Staff(serialNumber : '12453', name :'沈维伟', department : dept3310).save(flush:true)
        def staff42 = new Staff(serialNumber : '42', name :'李猛', department : dept3320).save(flush:true)
        def staff89 = new Staff(serialNumber : '89', name :'虞遥', department : dept3320).save(flush:true)
        def staff15095 = new Staff(serialNumber : '15095', name :'衣国军', department : dept3320).save(flush:true)
        def staff14691 = new Staff(serialNumber : '14691', name :'张元强', department : dept3320).save(flush:true)
        def staff14697 = new Staff(serialNumber : '14697', name :'蒋祖珑', department : dept3320).save(flush:true)
        def staff14157 = new Staff(serialNumber : '14157', name :'陈超', department : dept3320).save(flush:true)
        def staff12347 = new Staff(serialNumber : '12347', name :'方纯', department : dept3320).save(flush:true)
        def staff11151 = new Staff(serialNumber : '11151', name :'李明艳', department : dept3320).save(flush:true)
        def staff10133 = new Staff(serialNumber : '10133', name :'刘亮', department : dept3320).save(flush:true)
        def staff10209 = new Staff(serialNumber : '10209', name :'杨延雪', department : dept3320).save(flush:true)
        def staff14688 = new Staff(serialNumber : '14688', name :'曹亚军', department : dept3330).save(flush:true)
        def staff11733 = new Staff(serialNumber : '11733', name :'董冬', department : dept3330).save(flush:true)
        def staff11863 = new Staff(serialNumber : '11863', name :'高国淋', department : dept3330).save(flush:true)
        def staff10280 = new Staff(serialNumber : '10280', name :'王忠文', department : dept3330).save(flush:true)
        def staff10111 = new Staff(serialNumber : '10111', name :'沈亚林', department : dept3330).save(flush:true)
        def staff10970 = new Staff(serialNumber : '10970', name :'袁懿', department : dept3330).save(flush:true)
        def staff11112 = new Staff(serialNumber : '11112', name :'朱坚强', department : dept3330).save(flush:true)
        def staff10462 = new Staff(serialNumber : '10462', name :'刘峰', department : dept3330).save(flush:true)
        def staff11554 = new Staff(serialNumber : '11554', name :'程艳军', department : dept3330).save(flush:true)
        def staff14698 = new Staff(serialNumber : '14698', name :'孙谦', department : dept3330).save(flush:true)
        def staff14702 = new Staff(serialNumber : '14702', name :'王晗', department : dept3330).save(flush:true)
        def staff247 = new Staff(serialNumber : '247', name :'姜猛', department : dept3340).save(flush:true)
        def staff15456 = new Staff(serialNumber : '15456', name :'吕媛媛', department : dept3340).save(flush:true)
        def staff10848 = new Staff(serialNumber : '10848', name :'王舟', department : dept3340).save(flush:true)
        def staff14701 = new Staff(serialNumber : '14701', name :'石钊', department : dept3340).save(flush:true)
        def staff13287 = new Staff(serialNumber : '13287', name :'石超', department : dept3340).save(flush:true)
        def staff14968 = new Staff(serialNumber : '14968', name :'赵杰', department : dept3350).save(flush:true)
        def staff14208 = new Staff(serialNumber : '14208', name :'吴限敏', department : dept3350).save(flush:true)
        def staff13215 = new Staff(serialNumber : '13215', name :'汪阳', department : dept3350).save(flush:true)
        def staff16445 = new Staff(serialNumber : '16445', name :'双飞', department : dept3350).save(flush:true)
        def staff16446 = new Staff(serialNumber : '16446', name :'黄建水', department : dept3350).save(flush:true)
        def staff10556 = new Staff(serialNumber : '10556', name :'文杨', department : dept3350).save(flush:true)
        def staff11006 = new Staff(serialNumber : '11006', name :'赵小爱', department : dept3350).save(flush:true)
        def staff11741 = new Staff(serialNumber : '11741', name :'王飞', department : dept3350).save(flush:true)
        def staff16001 = new Staff(serialNumber : '16001', name :'魏丹', department : dept3360).save(flush:true)
        def staff11746 = new Staff(serialNumber : '11746', name :'鲁开红', department : dept3360).save(flush:true)
        def staff14986 = new Staff(serialNumber : '14986', name :'孙玉鹏', department : dept3410).save(flush:true)
        def staff15052 = new Staff(serialNumber : '15052', name :'李原树', department : dept3410).save(flush:true)
        def staff16507 = new Staff(serialNumber : '16507', name :'刘冬', department : dept3410).save(flush:true)
        def staff224 = new Staff(serialNumber : '224', name :'余献忠', department : dept3410).save(flush:true)
        def staff11479 = new Staff(serialNumber : '11479', name :'马洋', department : dept3410).save(flush:true)
        def staff11567 = new Staff(serialNumber : '11567', name :'王江波', department : dept3410).save(flush:true)
        def staff10868 = new Staff(serialNumber : '10868', name :'张伟', department : dept3410).save(flush:true)
        def staff10377 = new Staff(serialNumber : '10377', name :'张正江', department : dept3410).save(flush:true)
        def staff10162 = new Staff(serialNumber : '10162', name :'王震', department : dept3410).save(flush:true)
        def staff10155 = new Staff(serialNumber : '10155', name :'李玲', department : dept3410).save(flush:true)
        def staff11113 = new Staff(serialNumber : '11113', name :'孙忠伟', department : dept3410).save(flush:true)
        def staff13249 = new Staff(serialNumber : '13249', name :'吴晓燕', department : dept3410).save(flush:true)
        def staff13216 = new Staff(serialNumber : '13216', name :'刘苏丹', department : dept3410).save(flush:true)
        def staff14158 = new Staff(serialNumber : '14158', name :'范军', department : dept3420).save(flush:true)
        def staff14159 = new Staff(serialNumber : '14159', name :'李道明', department : dept3420).save(flush:true)
        def staff16454 = new Staff(serialNumber : '16454', name :'李园园', department : dept3420).save(flush:true)
        def staff16481 = new Staff(serialNumber : '16481', name :'吴智翔', department : dept3420).save(flush:true)
        def staff10258 = new Staff(serialNumber : '10258', name :'吴雨虹', department : dept3420).save(flush:true)
        def staff10275 = new Staff(serialNumber : '10275', name :'单士军', department : dept3420).save(flush:true)
        def staff13499 = new Staff(serialNumber : '13499', name :'张远志', department : dept3420).save(flush:true)
        def staff11884 = new Staff(serialNumber : '11884', name :'何丰池', department : dept3420).save(flush:true)
        def staff13219 = new Staff(serialNumber : '13219', name :'李晓莉', department : dept3420).save(flush:true)
        def staff15439 = new Staff(serialNumber : '15439', name :'鹿艳萍', department : dept3420).save(flush:true)
        def staff12469 = new Staff(serialNumber : '12469', name :'左文琪', department : dept3420).save(flush:true)
        def staff11137 = new Staff(serialNumber : '11137', name :'冯玉立', department : dept3430).save(flush:true)
        def staff11230 = new Staff(serialNumber : '11230', name :'魏国勇', department : dept3430).save(flush:true)
        def staff11474 = new Staff(serialNumber : '11474', name :'史朝杰', department : dept3430).save(flush:true)
        def staff11548 = new Staff(serialNumber : '11548', name :'张红涛', department : dept3430).save(flush:true)
        def staff11869 = new Staff(serialNumber : '11869', name :'赵飞', department : dept3430).save(flush:true)
        def staff11333 = new Staff(serialNumber : '11333', name :'张蕾', department : dept3430).save(flush:true)
        def staff14977 = new Staff(serialNumber : '14977', name :'赵正强', department : dept3430).save(flush:true)
        def staff15997 = new Staff(serialNumber : '15997', name :'张太茂', department : dept3430).save(flush:true)
        def staff15998 = new Staff(serialNumber : '15998', name :'刘国战', department : dept3430).save(flush:true)
        def staff14978 = new Staff(serialNumber : '14978', name :'靳小朋', department : dept3430).save(flush:true)
        def staff13127 = new Staff(serialNumber : '13127', name :'谢媛媛', department : dept3430).save(flush:true)
        def staff13128 = new Staff(serialNumber : '13128', name :'李旭', department : dept3430).save(flush:true)
        def staff14161 = new Staff(serialNumber : '14161', name :'查明耀', department : dept3440).save(flush:true)
        def staff303 = new Staff(serialNumber : '303', name :'张俊', department : dept3440).save(flush:true)
        def staff10312 = new Staff(serialNumber : '10312', name :'张纯', department : dept3440).save(flush:true)
        def staff11142 = new Staff(serialNumber : '11142', name :'方向', department : dept3440).save(flush:true)
        def staff10584 = new Staff(serialNumber : '10584', name :'李方平', department : dept3440).save(flush:true)
        def staff14723 = new Staff(serialNumber : '14723', name :'戴臣', department : dept3450).save(flush:true)
        def staff14707 = new Staff(serialNumber : '14707', name :'魏瑶', department : dept3450).save(flush:true)
        def staff10257 = new Staff(serialNumber : '10257', name :'高其梅', department : dept3450).save(flush:true)
        def staff10198 = new Staff(serialNumber : '10198', name :'程红梅', department : dept3450).save(flush:true)
        def staff10188 = new Staff(serialNumber : '10188', name :'胡耀庭', department : dept3450).save(flush:true)
        def staff13335 = new Staff(serialNumber : '13335', name :'舒孝军', department : dept3450).save(flush:true)
        def staff16313 = new Staff(serialNumber : '16313', name :'范高峰', department : dept3460).save(flush:true)
        def staff12422 = new Staff(serialNumber : '12422', name :'朱鹏', department : dept3460).save(flush:true)
        def staff11397 = new Staff(serialNumber : '11397', name :'徐惠', department : dept3460).save(flush:true)
        def staff16150 = new Staff(serialNumber : '16150', name :'薛莉莉', department : dept3460).save(flush:true)
        def staff16312 = new Staff(serialNumber : '16312', name :'景凌坤', department : dept3460).save(flush:true)
        def staff12366 = new Staff(serialNumber : '12366', name :'卜云陵', department : dept3460).save(flush:true)
        def staff221 = new Staff(serialNumber : '221', name :'吴铁良', department : dept3500).save(flush:true)
        def staff14154 = new Staff(serialNumber : '14154', name :'刘慧', department : dept3510).save(flush:true)
        def staff13537 = new Staff(serialNumber : '13537', name :'张矗', department : dept3510).save(flush:true)
        def staff15411 = new Staff(serialNumber : '15411', name :'栗俊平', department : dept3510).save(flush:true)
        def staff13476 = new Staff(serialNumber : '13476', name :'周可嘉', department : dept3510).save(flush:true)
        def staff10710 = new Staff(serialNumber : '10710', name :'王杰', department : dept3510).save(flush:true)
        def staff12041 = new Staff(serialNumber : '12041', name :'张凤亚', department : dept3510).save(flush:true)
        def staff13307 = new Staff(serialNumber : '13307', name :'商政臣', department : dept3510).save(flush:true)
        def staff13218 = new Staff(serialNumber : '13218', name :'王鹏', department : dept3510).save(flush:true)
        def staff14156 = new Staff(serialNumber : '14156', name :'季泽芊', department : dept3520).save(flush:true)
        def staff14048 = new Staff(serialNumber : '14048', name :'潘佳富', department : dept3520).save(flush:true)
        def staff14711 = new Staff(serialNumber : '14711', name :'周洪波', department : dept3520).save(flush:true)
        def staff15172 = new Staff(serialNumber : '15172', name :'秦成香', department : dept3520).save(flush:true)
        def staff196 = new Staff(serialNumber : '196', name :'曹磊', department : dept3520).save(flush:true)
        def staff10064 = new Staff(serialNumber : '10064', name :'李玉喜', department : dept3520).save(flush:true)
        def staff11902 = new Staff(serialNumber : '11902', name :'李彬', department : dept3520).save(flush:true)
        def staff12454 = new Staff(serialNumber : '12454', name :'郭雪飞', department : dept3520).save(flush:true)
        def staff14204 = new Staff(serialNumber : '14204', name :'赵益彬', department : dept3530).save(flush:true)
        def staff14207 = new Staff(serialNumber : '14207', name :'文馨', department : dept3530).save(flush:true)
        def staff16305 = new Staff(serialNumber : '16305', name :'张培昭', department : dept3530).save(flush:true)
        def staff13211 = new Staff(serialNumber : '13211', name :'汪镭', department : dept3530).save(flush:true)
        def staff10204 = new Staff(serialNumber : '10204', name :'王虹', department : dept3530).save(flush:true)
        def staff10290 = new Staff(serialNumber : '10290', name :'李宝', department : dept3530).save(flush:true)
        def staff10158 = new Staff(serialNumber : '10158', name :'宗胜玲', department : dept3530).save(flush:true)
        def staff10022 = new Staff(serialNumber : '10022', name :'吕秀凤', department : dept3530).save(flush:true)
        def staff11568 = new Staff(serialNumber : '11568', name :'闵磊', department : dept3530).save(flush:true)
        def staff12512 = new Staff(serialNumber : '12512', name :'杨天朗', department : dept3530).save(flush:true)
        def staff16287 = new Staff(serialNumber : '16287', name :'范庆顺', department : dept3540).save(flush:true)
        def staff16332 = new Staff(serialNumber : '16332', name :'刘涛', department : dept3540).save(flush:true)
        def staff13475 = new Staff(serialNumber : '13475', name :'樊志欣', department : dept3540).save(flush:true)
        def staff11334 = new Staff(serialNumber : '11334', name :'张军', department : dept3540).save(flush:true)
        def staff12108 = new Staff(serialNumber : '12108', name :'张鹏', department : dept3540).save(flush:true)
        def staff13103 = new Staff(serialNumber : '13103', name :'王义勇', department : dept3540).save(flush:true)
        def staff11918 = new Staff(serialNumber : '11918', name :'赵红志', department : dept3540).save(flush:true)
        def staff15622 = new Staff(serialNumber : '15622', name :'刘婧', department : dept3550).save(flush:true)
        def staff13093 = new Staff(serialNumber : '13093', name :'黄睿婷', department : dept3550).save(flush:true)
        def staff12447 = new Staff(serialNumber : '12447', name :'徐峰', department : dept3550).save(flush:true)
        def staff14054 = new Staff(serialNumber : '14054', name :'王撼诚', department : dept3560).save(flush:true)
        def staff12450 = new Staff(serialNumber : '12450', name :'张燕', department : dept3560).save(flush:true)
        def staff220 = new Staff(serialNumber : '220', name :'王伟', department : dept3600).save(flush:true)
        def staff194 = new Staff(serialNumber : '194', name :'王良', department : dept3610).save(flush:true)
        def staff15442 = new Staff(serialNumber : '15442', name :'王琦', department : dept3610).save(flush:true)
        def staff15458 = new Staff(serialNumber : '15458', name :'孙年丰', department : dept3610).save(flush:true)
        def staff10287 = new Staff(serialNumber : '10287', name :'万志成', department : dept3610).save(flush:true)
        def staff12473 = new Staff(serialNumber : '12473', name :'马万宇', department : dept3610).save(flush:true)
        def staff16484 = new Staff(serialNumber : '16484', name :'刘洋', department : dept3610).save(flush:true)
        def staff15443 = new Staff(serialNumber : '15443', name :'葛亮', department : dept3620).save(flush:true)
        def staff15444 = new Staff(serialNumber : '15444', name :'龚晶', department : dept3620).save(flush:true)
        def staff15620 = new Staff(serialNumber : '15620', name :'丁志强', department : dept3620).save(flush:true)
        def staff16254 = new Staff(serialNumber : '16254', name :'张景旭', department : dept3620).save(flush:true)
        def staff15702 = new Staff(serialNumber : '15702', name :'马元辉', department : dept3620).save(flush:true)
        def staff11058 = new Staff(serialNumber : '11058', name :'董晓丹', department : dept3620).save(flush:true)
        def staff15610 = new Staff(serialNumber : '15610', name :'李杭', department : dept3620).save(flush:true)
        def staff11057 = new Staff(serialNumber : '11057', name :'邱宏斌', department : dept3630).save(flush:true)
        def staff10053 = new Staff(serialNumber : '10053', name :'马腾飞', department : dept3630).save(flush:true)
        def staff15612 = new Staff(serialNumber : '15612', name :'赵晞如', department : dept3630).save(flush:true)
        def staff14209 = new Staff(serialNumber : '14209', name :'李德生', department : dept3630).save(flush:true)
        def staff15554 = new Staff(serialNumber : '15554', name :'石广喜', department : dept3630).save(flush:true)
        def staff15555 = new Staff(serialNumber : '15555', name :'马长宇', department : dept3630).save(flush:true)
        def staff14206 = new Staff(serialNumber : '14206', name :'高鑫', department : dept3640).save(flush:true)
        def staff11791 = new Staff(serialNumber : '11791', name :'肖锋', department : dept3640).save(flush:true)
        def staff16442 = new Staff(serialNumber : '16442', name :'王璐', department : dept3640).save(flush:true)
        def staff15621 = new Staff(serialNumber : '15621', name :'吴琼', department : dept3640).save(flush:true)
        def staff232 = new Staff(serialNumber : '232', name :'刘明新', department : dept3710).save(flush:true)
        def staff11060 = new Staff(serialNumber : '11060', name :'吴晓可', department : dept3710).save(flush:true)
        def staff11107 = new Staff(serialNumber : '11107', name :'臧勇', department : dept3710).save(flush:true)
        def staff10140 = new Staff(serialNumber : '10140', name :'吴飞', department : dept3710).save(flush:true)
        def staff12476 = new Staff(serialNumber : '12476', name :'王小滟', department : dept3710).save(flush:true)
        def staff11749 = new Staff(serialNumber : '11749', name :'张飞', department : dept3710).save(flush:true)
        def staff11871 = new Staff(serialNumber : '11871', name :'李海永', department : dept3710).save(flush:true)
        def staff15350 = new Staff(serialNumber : '15350', name :'熊可嘉', department : dept3710).save(flush:true)
        def staff15537 = new Staff(serialNumber : '15537', name :'刘翔', department : dept3710).save(flush:true)
        def staff15535 = new Staff(serialNumber : '15535', name :'胥远军', department : dept3710).save(flush:true)
        def staff15536 = new Staff(serialNumber : '15536', name :'朱林强', department : dept3710).save(flush:true)
        def staff11563 = new Staff(serialNumber : '11563', name :'丰华', department : dept3720).save(flush:true)
        def staff14120 = new Staff(serialNumber : '14120', name :'赵新建', department : dept3720).save(flush:true)
        def staff11470 = new Staff(serialNumber : '11470', name :'苏吉平', department : dept3720).save(flush:true)
        def staff10796 = new Staff(serialNumber : '10796', name :'邹志', department : dept3720).save(flush:true)
        def staff11469 = new Staff(serialNumber : '11469', name :'孙超雄', department : dept3720).save(flush:true)
        def staff11559 = new Staff(serialNumber : '11559', name :'陈柏延', department : dept3720).save(flush:true)
        def staff13421 = new Staff(serialNumber : '13421', name :'王兵', department : dept3720).save(flush:true)
        def staff16496 = new Staff(serialNumber : '16496', name :'李发云', department : dept3720).save(flush:true)
        def staff14716 = new Staff(serialNumber : '14716', name :'刑海川', department : dept3720).save(flush:true)
        def staff15552 = new Staff(serialNumber : '15552', name :'刘逸飞', department : dept3720).save(flush:true)
        def staff15551 = new Staff(serialNumber : '15551', name :'张先洪', department : dept3720).save(flush:true)
        def staff12475 = new Staff(serialNumber : '12475', name :'聂杨', department : dept3720).save(flush:true)
        def staff13091 = new Staff(serialNumber : '13091', name :'赵伟庆', department : dept3730).save(flush:true)
        def staff14049 = new Staff(serialNumber : '14049', name :'杨江平', department : dept3730).save(flush:true)
        def staff15999 = new Staff(serialNumber : '15999', name :'肖瑞芳', department : dept3730).save(flush:true)
        def staff13199 = new Staff(serialNumber : '13199', name :'孙侃', department : dept3730).save(flush:true)
        def staff15231 = new Staff(serialNumber : '15231', name :'张立', department : dept3730).save(flush:true)
        def staff15553 = new Staff(serialNumber : '15553', name :'李小勇', department : dept3730).save(flush:true)
        def staff15593 = new Staff(serialNumber : '15593', name :'石红', department : dept3740).save(flush:true)
        def staff11860 = new Staff(serialNumber : '11860', name :'钟博', department : dept3740).save(flush:true)
        def staff14712 = new Staff(serialNumber : '14712', name :'王加会', department : dept3740).save(flush:true)
        def staff16374 = new Staff(serialNumber : '16374', name :'梁宏微', department : dept3750).save(flush:true)
        def staff15543 = new Staff(serialNumber : '15543', name :'李睿', department : dept3750).save(flush:true)
        def staff10304 = new Staff(serialNumber : '10304', name :'刘沪英', department : dept3800).save(flush:true)
        def staff11761 = new Staff(serialNumber : '11761', name :'王平平', department : dept3810).save(flush:true)
        def staff14696 = new Staff(serialNumber : '14696', name :'时鹏', department : dept3810).save(flush:true)
        def staff10551 = new Staff(serialNumber : '10551', name :'胡义', department : dept3810).save(flush:true)
        def staff13074 = new Staff(serialNumber : '13074', name :'彭小苗', department : dept3810).save(flush:true)
        def staff11075 = new Staff(serialNumber : '11075', name :'韩飞', department : dept3810).save(flush:true)
        def staff11879 = new Staff(serialNumber : '11879', name :'刘金辉', department : dept3820).save(flush:true)
        def staff12440 = new Staff(serialNumber : '12440', name :'詹志凯', department : dept3820).save(flush:true)
        def staff14690 = new Staff(serialNumber : '14690', name :'黄瑜韵', department : dept3820).save(flush:true)
        def staff10291 = new Staff(serialNumber : '10291', name :'王久香', department : dept3820).save(flush:true)
        def staff10430 = new Staff(serialNumber : '10430', name :'孙彬', department : dept3820).save(flush:true)
        def staff15594 = new Staff(serialNumber : '15594', name :'周瑞林', department : dept3830).save(flush:true)
        def staff15454 = new Staff(serialNumber : '15454', name :'胡小瑞', department : dept3830).save(flush:true)
        def staff10080 = new Staff(serialNumber : '10080', name :'刘露娟', department : dept3830).save(flush:true)
        def staff11558 = new Staff(serialNumber : '11558', name :'朱营营', department : dept3830).save(flush:true)
        def staff11114 = new Staff(serialNumber : '11114', name :'黄娟华', department : dept3830).save(flush:true)
        def staff10565 = new Staff(serialNumber : '10565', name :'徐长亮', department : dept3830).save(flush:true)
        def staff10322 = new Staff(serialNumber : '10322', name :'王力雄', department : dept3830).save(flush:true)
        def staff10210 = new Staff(serialNumber : '10210', name :'李晓辉', department : dept3830).save(flush:true)

        /*init dealer*/
        def ownerAH0001 = new User(username: "AH0001".toLowerCase(),  passwordHash: new Sha512Hash("AH0001").toHex(), profile:dealerProfile).save(flush:true)
        def dealerAH0001 = new Dealer(department:dept3450, serialNumber:'AH0001', name:'合肥博大电气有限公司', alias:'合肥博大电气', shortcut:'BDDQ', salesMan:staff10210, head:'侯卫民', contact:'夏秋霞', address1 : '安微省合肥市高新区望江西路539号鲲鹏科技园', address2 : '侯卫民 0551-5310128 13856002226', approvalStatus:'已核准', pricingMode:'折扣率', owner : ownerAH0001 ).save(flush:true)

        def ownerAH0002 = new User(username: "AH0002".toLowerCase(),  passwordHash: new Sha512Hash("AH0002").toHex(), profile:dealerProfile).save(flush:true)
        def dealerAH0002 = new Dealer(department:dept3450, serialNumber:'AH0002', name:'合肥越天电气自动化有限公司', alias:'合肥越天电气', shortcut:'YTDQ', salesMan:staff10210, head:'杜越天', contact:'杜越天', address1 : '合肥市濉溪东路14号', address2 : '', approvalStatus:'不准交易'     , pricingMode:'折扣率', owner : ownerAH0002  ).save(flush:true)
       
        def ownerAH0003 = new User(username: "AH0003".toLowerCase(),  passwordHash: new Sha512Hash("AH0003").toHex(), profile:dealerProfile).save(flush:true)
        def dealerAH0003 = new Dealer(department:dept3450, serialNumber:'AH0003', name:'合肥阳光电源有限公司', alias:'合肥阳光电源', shortcut:'YGDY', salesMan:staff10210, head:'', contact:'史大贵139056089127', address1 : '安徽省合肥市高新区天湖路2号采购部 史大贵139056089127', address2 : '', approvalStatus:'不准交易'     , pricingMode:'折扣率', owner : ownerAH0003  ).save(flush:true)
       
        def ownerAH0004 = new User(username: "AH0004".toLowerCase(),  passwordHash: new Sha512Hash("AH0004").toHex(), profile:dealerProfile).save(flush:true)
        def dealerAH0004 = new Dealer(department:dept3450, serialNumber:'AH0004', name:'安庆市良信电力设备有限责任公司', alias:'安庆良信电力', shortcut:'AQLXDL', salesMan:staff10210, head:'', contact:''     , address1 : '', address2 : '', approvalStatus:'已核准'     , pricingMode:'折扣率' , owner : ownerAH0004 ).save(flush:true)
       
        def ownerAH0005 = new User(username: "AH0005".toLowerCase(),  passwordHash: new Sha512Hash("AH0005").toHex(), profile:dealerProfile).save(flush:true)
        def dealerAH0005 = new Dealer(department:dept3450, serialNumber:'AH0005', name:'合肥宇嘉电气有限公司', alias:'合肥宇嘉电气', shortcut:'YJDQ', salesMan:staff10210, head:'石敏', contact:'石敏'     , address1 : '合肥市宿州路60号太阳城大厦615室', address2 : '', approvalStatus:'不准交易'     , pricingMode:'折扣率' , owner : ownerAH0005 ).save(flush:true)
       
        def ownerAH0006 = new User(username: "AH0006".toLowerCase(),  passwordHash: new Sha512Hash("AH0006").toHex(), profile:dealerProfile).save(flush:true)
        def dealerAH0006 = new Dealer(department:dept3450, serialNumber:'AH0006', name:'合肥竺禹商贸有限公司', alias:'合肥竺禹商贸', shortcut:'ZYSM', salesMan:staff10210, head:'余晞', contact:'余晞'     , address1 : '', address2 : '合肥市宁国路152号', approvalStatus:'不准交易'     , pricingMode:'折扣率' , owner : ownerAH0006 ).save(flush:true)
       
        def ownerAH0007 = new User(username: "AH0007".toLowerCase(),  passwordHash: new Sha512Hash("AH0007").toHex(), profile:dealerProfile).save(flush:true)
        def dealerAH0007 = new Dealer(department:dept3450, serialNumber:'AH0007', name:'安徽科维信息系统有限公司', alias:'安徽科维', shortcut:'', salesMan:staff10210, head:'', contact:'', address1 : '合肥市高新区天智路20号科大创新201室   0551-5327958/5325861', address2 : 'FAX:0551-5327968  张程敏 13966698260/陈智15155171767', approvalStatus:'不准交易'     , pricingMode:'折扣率' , owner : ownerAH0007 ).save(flush:true)
       
        def ownerAH0008 = new User(username: "AH0008".toLowerCase(),  passwordHash: new Sha512Hash("AH0008").toHex(), profile:dealerProfile).save(flush:true)
        def dealerAH0008 = new Dealer(department:dept3510, serialNumber:'AH0008', name:'安徽动力源科技有限公司', alias:'安徽动力源', shortcut:'AHDLY', salesMan:staff10210, head:'', contact:'', address1 : '安徽省宣城市郎溪县经济开发区安徽动力源科技有限公司 0563-7026968', address2 : '吴昆 13966197199 0563-2316821', approvalStatus:'已核准'     , pricingMode:'折扣率' , owner : ownerAH0008 ).save(flush:true)
       
        def ownerBJ0001 = new User(username: "BJ0001".toLowerCase(),  passwordHash: new Sha512Hash("BJ0001").toHex(), profile:dealerProfile).save(flush:true)
        def dealerBJ0001 = new Dealer(department:dept3510, serialNumber:'BJ0001', name:'北京茂程科贸有限公司', alias:'北京茂程科贸', shortcut:'MCKM', salesMan:staff10210, head:'', contact:'经理程旭', address1 : '北京市海淀区中关村大街E世界A区1138室', address2 : '提货人：汲怀磊 010-82387299-602/13261788805', approvalStatus:'已核准'     , pricingMode:'折扣率', owner : ownerBJ0001  ).save(flush:true)
       
        def ownerBJ0002 = new User(username: "BJ0002".toLowerCase(),  passwordHash: new Sha512Hash("BJ0002").toHex(), profile:dealerProfile).save(flush:true)
        def dealerBJ0002 = new Dealer(department:dept3510, serialNumber:'BJ0002', name:'北京索普尼科技有限公司', alias:'北京索普尼', shortcut:'SPN', salesMan:staff10210, head:'冯西平', contact:'赵鉴华', address1 : '', address2 : '', approvalStatus:'不准交易'     , pricingMode:'' , owner : ownerBJ0002 ).save(flush:true)
       
        def ownerBJ0003 = new User(username: "BJ0003".toLowerCase(),  passwordHash: new Sha512Hash("BJ0003").toHex(), profile:dealerProfile).save(flush:true)
        def dealerBJ0003 = new Dealer(department:dept3510, serialNumber:'BJ0003', name:'北京东方博飞电力技术有限责任公司', alias:'北京东方博飞', shortcut:'DFBF', salesMan:staff10210, head:'冯西平', contact:'刘建中', address1 : '', address2 : '', approvalStatus:'不准交易'     , pricingMode:'' , owner : ownerBJ0003 ).save(flush:true)
       
        def ownerBJ0004 = new User(username: "BJ0004".toLowerCase(),  passwordHash: new Sha512Hash("BJ0004").toHex(), profile:dealerProfile).save(flush:true)
        def dealerBJ0004 = new Dealer(department:dept3510, serialNumber:'BJ0004', name:'北京动力源科技股份有限公司', alias:'动力源', shortcut:'DLY', salesMan:staff10210, head:'赖华明', contact:'采购田源 010-63795656', address1 : '提货人：汲怀磊 010-82387299-602/13261788805', address2 : '赖华明  13601038908', approvalStatus:'已核准'     , pricingMode:'' , owner : ownerBJ0004 ).save(flush:true)
       
        def ownerBJ0005 = new User(username: "BJ0005".toLowerCase(),  passwordHash: new Sha512Hash("BJ0005").toHex(), profile:dealerProfile).save(flush:true)
        def dealerBJ0005 = new Dealer(department:dept3510, serialNumber:'BJ0005', name:'北京联鸿电器有限公司', alias:'北京联鸿电器', shortcut:'LHDQ', salesMan:staff10210, head:'董江峰', contact:'董江峰', address1 : '北京市顺义区俸伯北区4号楼2门301', address2 : '董江峰 010-89476873  (到货顺义）', approvalStatus:'不准交易'     , pricingMode:'' , owner : ownerBJ0005 ).save(flush:true)
       
        def ownerSH0013 = new User(username: "SH0013".toLowerCase(),  passwordHash: new Sha512Hash("SH0013").toHex(), profile:dealerProfile).save(flush:true)
        def dealerSH0013 = new Dealer(department:dept3310, serialNumber:'SH0013', name:'浙江海得电气实业有限公司', alias:'浙江海得电气', shortcut:null, salesMan:staff10854, head:'', contact:'', address1 : '桐乡经济开发区三期工业区人民南路东厂房2楼海得运营仓库  0573－80881368', address2 : '联系人:王宏燕 0573-80881367 13819412011', approvalStatus:'已核准', pricingMode:'' , owner : ownerSH0013 ).save(flush:true)
       
        def ownerGD0020 = new User(username: "GD0020".toLowerCase(),  passwordHash: new Sha512Hash("GD0020").toHex(), profile:dealerProfile).save(flush:true)
        def dealerGD0020 = new Dealer(department:dept3220, serialNumber:'GD0020', name:'东莞市昊泰电器有限公司', alias:'东莞昊泰', shortcut:'HT', salesMan:staff13073, head:'', contact:'', address1 : '东莞市东城区竹主山鸿怡花园C座3D-307  0769-22667676', address2 : '张孝祥  0769-22667676   13018608615', approvalStatus:'已核准', pricingMode:'', owner : ownerGD0020  ).save(flush:true)


        def roleDealer = new Role(name:"Dealer Role")
        .addToPermissions("index:*")
        .addToPermissions("nav:*")
        .addToPermissions("auth:*")
        .addToPermissions("welcome:*")

        .addToPermissions("contract:index")
        .addToPermissions("contract:list")
        .addToPermissions("contract:show")

        .addToPermissions("salesOrder:index")
        .addToPermissions("salesOrder:list")
        .addToPermissions("salesOrder:create")
        .addToPermissions("salesOrder:save")
        .addToPermissions("salesOrder:show")
        .addToPermissions("salesOrder:edit")
        .addToPermissions("salesOrder:update")

		.addToPermissions("salesOrderAjax:*")

        .addToPermissions("workflowApproval:confirm")
        .addToPermissions("workflowApproval:approval")

        .addToPermissions("report:run")
        .addToPermissions("report:view")

        .addToPermissions("outBound:index")
        .addToPermissions("outBound:list")
        .addToPermissions("outBound:show")
        .addToPermissions("outBound:resurrect")
        .addToPermissions("outBound:showXml")

        .addToPermissions("creditControl:index")
        .addToPermissions("creditControl:list")
        .addToPermissions("creditControl:show")

        .addToUsers(ownerAH0001)
        .addToUsers(ownerAH0002)
        .addToUsers(ownerAH0003)
        .addToUsers(ownerAH0004)
        .addToUsers(ownerAH0005)
        .addToUsers(ownerAH0006)
        .addToUsers(ownerAH0007)
        .addToUsers(ownerAH0008)
        .addToUsers(ownerBJ0001)
        .addToUsers(ownerBJ0002)
        .addToUsers(ownerBJ0003)
        .addToUsers(ownerBJ0004)
        .addToUsers(ownerBJ0005)
        .addToUsers(ownerSH0013)
        .addToUsers(ownerGD0020)
        .save(flush:true)

        /*init contract*/
        def recordType21 = new RecordType (serialNumber : '1', name : '行业特价申请', domain : 'contract',  isActive : true, description : '').save(flush:true)
        def recordType22 = new RecordType (serialNumber : '2', name : '非行业特价申请', domain : 'contract',  isActive : true, description : '').save(flush:true)
       /*init industry*/
        def channelGK0001 = new Industry( serialNumber:"GK0001", shortName:"工控", fullName:"工业控制", isActive:true, description:"与工业设备配套的控制系统行业。如机床设备、机械设备、电梯设备等。").save(flush:true)
        new Industry(serialNumber:"GY0008", shortName:"铁路", fullName:"铁路", isActive:false, description:"包含动车、地铁、电力机车、城际列车、车载空调、铁路系统等").save(flush:true)
        def channelGY1001 = new Industry(serialNumber:"GY1001", shortName:"电信", fullName:"电信", isActive:true, description:"包含通讯电源、电讯设备").save(flush:true)
        new Industry(serialNumber:"ID9999", shortName:"其他", fullName:"其他", isActive:false, description:"上述不使用的其他行业").save(flush:true)
        new Industry(serialNumber:"JZGJ01", shortName:"建筑", fullName:"建筑", isActive:true, description:"包含工业厂房（冶金、石化、水泥等）配套及改建").save(flush:true)
        new Industry(serialNumber:"JZMJ01", shortName:"公建/住宅", fullName:"公建/住宅", isActive:false, description:"包含政府、事业单位如机关、学校、医院等兴建的各类项目以及各类商业住宅、民用住宅等房产行业").save(flush:true)
        new Industry(serialNumber:"NYDL01", shortName:"电力", fullName:"电力", isActive:true, description:"指各级电力系统、电业局等").save(flush:true)
        new Industry(serialNumber:"NYDL02", shortName:"电力电源", fullName:"电力电源", isActive:true, description:"包含继电保护、变电站自动化、配电自动化等").save(flush:true)
        new Industry(serialNumber:"OEM", shortName:"OEM", fullName:"OEM", isActive:false, description:"指我司为其他公司代工的情况").save(flush:true)

 
        /*Category*/
        def recordType11 = new RecordType (serialNumber : '1', name : '会计', domain : 'category',  isActive : true, description : '').save(flush:true)
        def recordType12 = new RecordType (serialNumber : '2', name : '仓管', domain : 'category',  isActive : true, description : '').save(flush:true)
        def recordType13 = new RecordType (serialNumber : '3', name : '产品', domain : 'category',  isActive : true, description : '').save(flush:true)
        def recordType14 = new RecordType (serialNumber : '4', name : '客户', domain : 'category',  isActive : true, description : '').save(flush:true)
        def recordType15 = new RecordType (serialNumber : '5', name : '属性', domain : 'category',  isActive : true, description : '').save(flush:true)
        
        def category11_01 = new Category (recordType : recordType11, serialNumber : '01', name : '零部件', discount : 0, productionCycle:0, transportCycle:0, isActive:true).save(flush:true)
        def category11_02 = new Category (recordType : recordType11, serialNumber : '02', name : '辅料包材', discount : 0, productionCycle:0, transportCycle:0, isActive:true).save(flush:true)
        def category11_04 = new Category (recordType : recordType11, serialNumber : '04', name : '产成品', discount : 0, productionCycle:0, transportCycle:0, isActive:true).save(flush:true)
        def category11_09 = new Category (recordType : recordType11, serialNumber : '09', name : '外购成品', discount : 0, productionCycle:0, transportCycle:0, isActive:true).save(flush:true)

        def category12_001 = new Category (recordType : recordType12, serialNumber : '001', name : 'NDM1-63', discount : 0, productionCycle:2, transportCycle:5, isActive:true).save(flush:true)
        def category12_001A = new Category (recordType : recordType12, serialNumber : '001A', name : 'NDM1A-63', discount : 0,productionCycle:2, transportCycle:5, isActive:true).save(flush:true)
        def category12_001B = new Category (recordType : recordType12, serialNumber : '001B', name : 'NDB1C-63', discount : 0,productionCycle:2, transportCycle:5, isActive:true).save(flush:true)
        def category12_002 = new Category (recordType : recordType12, serialNumber : '002', name : 'NDM1-125', discount : 0, productionCycle:2, transportCycle:5, isActive:true).save(flush:true)
        def category12_002A = new Category (recordType : recordType12, serialNumber : '002A', name : 'NDM1A-125', discount : 0, productionCycle:2, transportCycle:5, isActive:true).save(flush:true)
        def category12_003 = new Category (recordType : recordType12, serialNumber : '003', name : 'NDM1L-32', discount : 0, productionCycle:2, transportCycle:5, isActive:true).save(flush:true)
        def category12_031 = new Category (recordType : recordType12, serialNumber : '031', name : 'NDB1GQ', discount : 0, productionCycle:2, transportCycle:5, isActive:true).save(flush:true)
        def category12_032 = new Category (recordType : recordType12, serialNumber : '032', name : 'NDM1GQ', discount : 0, productionCycle:2, transportCycle:5, isActive:true).save(flush:true)
        def category12_103 = new Category (recordType : recordType12, serialNumber : '103', name : 'NDW1-2000', discount : 0, productionCycle:2, transportCycle:5, isActive:true).save(flush:true)
        def category12_1011 = new Category (recordType : recordType12, serialNumber : '1011', name : 'NDM2-225', discount : 0, productionCycle:2, transportCycle:5, isActive:true).save(flush:true)

        def category13_A01 = new Category (recordType : recordType13, serialNumber : 'A01', name : 'NDM1-63系列', discount : 0,productionCycle:0, transportCycle:0, isActive:true).save(flush:true)
        def category13_A02 = new Category (recordType : recordType13, serialNumber : 'A02', name : 'NDM1-125系列', discount : 0,productionCycle:0, transportCycle:0, isActive:true).save(flush:true)
        def category13_A03 = new Category (recordType : recordType13, serialNumber : 'A03', name : 'NDB1-32系列', discount : 0, productionCycle:0, transportCycle:0, isActive:true).save(flush:true)
        def category13_A04 = new Category (recordType : recordType13, serialNumber : 'A04', name : 'NDB1L-32系列', discount : 0, productionCycle:0, transportCycle:0, isActive:true).save(flush:true)
        def category13_A05 = new Category (recordType : recordType13, serialNumber : 'A05', name : 'NDB2-63系列', discount : 0, productionCycle:0, transportCycle:0, isActive:true).save(flush:true)
        def category13_A06 = new Category (recordType : recordType13, serialNumber : 'A06', name : 'NDM1L-3/5/10', discount : 0,productionCycle:0, transportCycle:0, isActive:true).save(flush:true)
        def category13_A09 = new Category (recordType : recordType13, serialNumber : 'A09', name : 'NDM2系列', discount : 0, productionCycle:0, transportCycle:0, isActive:true).save(flush:true) 
        def category13_A16 = new Category (recordType : recordType13, serialNumber : 'A16', name : 'NDW1-系列', discount : 0,productionCycle:0, transportCycle:0, isActive:true).save(flush:true)

        def category14_B01 = new Category (recordType : recordType14, serialNumber : 'B01', name : '良信', discount : 0, productionCycle:0, transportCycle:0, isActive:true).save(flush:true)
        def category14_B12 = new Category (recordType : recordType14, serialNumber : 'B12', name : 'OEM-ETA', discount : 0, productionCycle:0, transportCycle:0, isActive:true).save(flush:true)
        def category14_B13 = new Category (recordType : recordType14, serialNumber : 'B13', name : 'OEM-VIKO', discount : 0, productionCycle:0, transportCycle:0, isActive:true).save(flush:true)
        def category14_B14 = new Category (recordType : recordType14, serialNumber : 'B14', name : 'OEM-固安捷', discount : 0, productionCycle:0, transportCycle:0, isActive:true).save(flush:true)
        def category14_B15 = new Category (recordType : recordType14, serialNumber : 'B15', name : 'OEM-松下', discount : 0, productionCycle:0, transportCycle:0, isActive:true).save(flush:true)
        def category14_B99 = new Category (recordType : recordType14, serialNumber : 'B99', name : '外购成品', discount : 0, productionCycle:0, transportCycle:0, isActive:true).save(flush:true)
                
        def category15_001 = new Category (recordType : recordType15, serialNumber : '001', name : '主件（小断）', discount : 0.62, productionCycle:0, transportCycle:0, isActive:true, isAllowSpecialDiscount:true, isAllowZeroPrice : true).save(flush:true)

        def category15_002 = new Category (recordType : recordType15, serialNumber : '002', name : '附件（小断）', discount : 0.62,productionCycle:0, transportCycle:0, isActive:true, isAllowSpecialDiscount:true, isAllowZeroPrice : true).save(flush:true)

        def category15_003 = new Category (recordType : recordType15, serialNumber : '003', name : '主附件(小断)', discount : 0.62,productionCycle:0, transportCycle:0,hasBom:true, isActive:true, isAllowSpecialDiscount:true, isAllowZeroPrice : true).save(flush:true)

        def category15_004 = new Category (recordType : recordType15, serialNumber : '004', name : '主件(高分断)', discount : 0.65,productionCycle:0, transportCycle:0, isActive:true, isAllowSpecialDiscount:true, isAllowZeroPrice : true).save(flush:true)
        def category15_005 = new Category (recordType : recordType15, serialNumber : '005', name : '附件(高分断)', discount : 0.65,productionCycle:0, transportCycle:0, isActive:true, isAllowSpecialDiscount:true, isAllowZeroPrice : true).save(flush:true)
        def category15_011 = new Category (recordType : recordType15, serialNumber : '011', name : '本体(朔壳)', discount : 0.625,productionCycle:0, transportCycle:0, hasBom:true, isActive:true, isAllowSpecialDiscount:true, isAllowZeroPrice : true).save(flush:true)
        def category15_012 = new Category (recordType : recordType15, serialNumber : '012', name : '附件(朔壳)', discount : 0.625,productionCycle:0, transportCycle:0, hasBom:true, isActive:true, isAllowZeroPrice : true).save(flush:true)
        def category15_013 = new Category (recordType : recordType15, serialNumber : '013', name : '本附件(朔壳)', discount : 0.625,productionCycle:0, transportCycle:0, hasBom:true, isActive:true, isAllowZeroPrice : true).save(flush:true)
        def category15_015 = new Category (recordType : recordType15, serialNumber : '015', name : '本体(框架)', discount : 0.7,productionCycle:0, transportCycle:0, isActive:true, isAllowSpecialDiscount:true).save(flush:true)
        def category15_016 = new Category (recordType : recordType15, serialNumber : '016', name : '附件(框架)', discount : 1,productionCycle:0, transportCycle:0, isActive:true, isAllowZeroPrice : true).save(flush:true)
        def category15_017 = new Category (recordType : recordType15, serialNumber : '017', name : '本附件(框架)', discount : 0.7,productionCycle:0, transportCycle:0,hasBom:true, isActive:true, isAllowZeroPrice : true).save(flush:true)
        def category15_027 = new Category (recordType : recordType15, serialNumber : '027', name : 'NDB1C系列', discount : 0.6,productionCycle:0, transportCycle:0,hasBom:false, isActive:true, isAllowSpecialDiscount:true, isAllowZeroPrice : true).save(flush:true)
        def category15_999 = new Category (recordType : recordType15, serialNumber : '999', name : '零部件单供', discount : 1,productionCycle:0, transportCycle:0,hasBom:true, isActive:true, isAllowZeroPrice : true).save(flush:true)

        //bom主附件定价 220
        def p3600096 = new Product(serialNumber:'3600096', name:'NDW1智能型万能式断路器', standard:'NDW1-SZ32(IC1600A/4/K3H32S2/Q23/M)', unit : '套', price : 0, isIncludeTax: true, isActive:true)
            .addToCategories(new ProductCategory(category : category11_04))
            .addToCategories(new ProductCategory(category : category12_103))
            .addToCategories(new ProductCategory(category : category13_A16))
            .addToCategories(new ProductCategory(category : category14_B01))
            .addToCategories(new ProductCategory(category : category15_017))
            .save(flush:true)
            
        def p20001708 = new Product(serialNumber:'20001708', name:'框架虚设附件', standard:'NDW1 门框(框I/抽屉式)', unit : '套', price : 100, isIncludeTax: true, isActive:true)
            .addToCategories(new ProductCategory(category : category11_01))
            .addToCategories(new ProductCategory(category : category12_103))
            .addToCategories(new ProductCategory(category : category15_016))
            .save(flush:true)
            
        def p20001711 = new Product(serialNumber:'20001711', name:'框架虚设附件', standard:'NDW1 欠压延时脱扣器（框I/AC220V/可调）', unit : '套', price : 600, isIncludeTax: true, isActive:true)
            .addToCategories(new ProductCategory(category : category11_01))
            .addToCategories(new ProductCategory(category : category12_103))
            .addToCategories(new ProductCategory(category : category15_016))
            .save(flush:true)
            
        def p20001761 = new Product(serialNumber:'20001761', name:'框架虚设附件', standard:'NDW1 三锁两钥匙', unit : '套', price : 1000, isIncludeTax: true, isActive:true)
            .addToCategories(new ProductCategory(category : category11_01))
            .addToCategories(new ProductCategory(category : category12_103))
            .addToCategories(new ProductCategory(category : category15_016))
            .save(flush:true)
            
        def p20002236 = new Product(serialNumber:'20002236', name:'框架本体（虚设）', standard:'NDW1-2000C 1600A/4/K3H32S2/D2F2B2', unit : '台', price : 24347.4, isIncludeTax: true, isActive:true)
            .addToCategories(new ProductCategory(category : category11_01))
            .addToCategories(new ProductCategory(category : category12_103))
            .addToCategories(new ProductCategory(category : category15_015))
            .save(flush:true)
        def bomp3600096 = new Bom(product:p3600096)
            .addToBomDetails(new BomDetail(serialNumber: '0010', product:p20001708, dosage:3, quota : 1))
            .addToBomDetails(new BomDetail(serialNumber: '0020', product:p20001711, dosage:3, quota : 2))
            .addToBomDetails(new BomDetail(serialNumber: '0030', product:p20001761, dosage:1, quota : 3))
            .addToBomDetails(new BomDetail(serialNumber: '0040', product:p20002236, dosage:3, quota : 4))
            .save(flush:true)

        //221
        def p3008245 = new Product(serialNumber:'3008245', name:'过欠压断路器', standard:'NDM1GQ-50 C40/4（NDB1C-63）', unit : '台', price : 0, isIncludeTax: false, isActive:true)
            .addToCategories(new ProductCategory(category : category11_04))
            .addToCategories(new ProductCategory(category : category12_032))
            .addToCategories(new ProductCategory(category : category13_A06))
            .addToCategories(new ProductCategory(category : category14_B01))
            .addToCategories(new ProductCategory(category : category15_003))
            .save(flush:true)
        def p18300257 = new Product(serialNumber:'18300257', name:'NDM1CL-32/50罩 RoHS', standard:'8LD.300.257 4P', unit : '根', price : 0, isIncludeTax: false, isActive:true)
            .addToCategories(new ProductCategory(category : category11_01))
            .addToCategories(new ProductCategory(category : category12_032))
            .save(flush:true)

        def p18907103 = new Product(serialNumber:'18907103', name:'NDM1L-32/50漏电拼装盘头螺钉', standard:'GB823-88 M3*25', unit : '根', price : 0.070200, isIncludeTax: true, isActive:true)
            .addToCategories(new ProductCategory(category : category11_01))
            .addToCategories(new ProductCategory(category : category12_003))
            .addToCategories(new ProductCategory(category : category13_A06))
            .addToCategories(new ProductCategory(category : category15_999))
            .save(flush:true)
        def p1890710316 = new Product(serialNumber:'1890710316', name:'NDM1L-32拼装螺钉73.2mm RoHS', standard:'8LD.907.103.16', unit : '根', price : 0, isIncludeTax: false, isActive:true)
            .addToCategories(new ProductCategory(category : category11_01))
            .addToCategories(new ProductCategory(category : category12_003))
            .save(flush:true)

                    
        def p3008804 = new Product(serialNumber:'3008804', name:'小型断路器 RoHS', standard:'NDB1C-63 C40/4', unit : '台', price : 123.300000, isIncludeTax: true, isActive:true)
            .addToCategories(new ProductCategory(category : category11_04))
            .addToCategories(new ProductCategory(category : category12_001B))
            .addToCategories(new ProductCategory(category : category13_A01))
            .addToCategories(new ProductCategory(category : category14_B01))
            .addToCategories(new ProductCategory(category : category15_027))
            .save(flush:true)

        def p3008017 = new Product(serialNumber:'3008017', name:'过欠压脱扣器 RoHS', standard:'NDM1GQ-50/4P （NDB1C-63）', unit : '台', price : 0, isIncludeTax: true, isActive:true)
            .addToCategories(new ProductCategory(category : category11_04))
            .addToCategories(new ProductCategory(category : category12_031))
            .addToCategories(new ProductCategory(category : category13_A06))
            .addToCategories(new ProductCategory(category : category14_B01))
            .addToCategories(new ProductCategory(category : category15_001))
            .save(flush:true)
        def bom3008245 = new Bom(product:p3008245)
            .addToBomDetails(new BomDetail(serialNumber: '0010', product:p18300257, dosage:1, quota : 1))
            .addToBomDetails(new BomDetail(serialNumber: '0020', product:p18907103, dosage:1, quota : 2))
            .addToBomDetails(new BomDetail(serialNumber: '0030', product:p1890710316, dosage:2, quota : 3))
            .addToBomDetails(new BomDetail(serialNumber: '0040', product:p3008804, dosage:1, quota : 4))
            .addToBomDetails(new BomDetail(serialNumber: '0050', product:p3008017, dosage:1, quota : 5))
            .save(flush:true)
        def contractYX24Z201108030005 = new Contract(
            serialNumber:'YX24Z201108030005'
            , recordType:recordType21
            , subject : '夏弗纳-行业大客户申请表'
            , applicant:'张柳'
            , filingDate : new Date()
            , effectiveDate:new Date() + 1
            , dealer : dealerSH0013
            , project : '夏弗纳'
            , industry : channelGY1001
            , description : '夏弗纳电磁容是行业大客户，生产产品与埃德一样，主要生产滤波模块。目前有一个大唐项目使用我司NDB3-100 Z2/1LSA2A0R产品。经过前期技术确认和商务沟通，我们的报价略高于埃德，需要申请特价支持，请刘经理给予支持。'
            , createdBy : adminUser
            , lastModifiedBy:adminUser
            , owner:ownerSH0013)
            .addToContractDetails(
                new ContractDetail(serialNumber:'1', category : category12_103, discount : 0.62, specialDiscount: 0.32, finalDiscount:0.42, expiryDate : new Date() + 180)
            ).save(flush:true)
        /*221 非行业特价申请单*/
        def contractYX09G201108190041 = new Contract(
            serialNumber:'YX09G201108190041'
            , recordType:recordType22
            , subject : '东莞昊泰-雍景豪苑-非行业大客户申请表'
            , applicant:'刘华丽'
            , filingDate : new Date()
            , effectiveDate:new Date() + 1
            , dealer : dealerGD0020
            , project : '雍景豪苑'
            , industry : channelGK0001
            , description : '雍景地产是东莞区域重点房地产项目之一，其目前开发了雍景豪苑等住宅小区，并开始分批采购我司产品，预计采购量30万左右，现向公司申请5个大点的议价，请公司领导给予支持分盼，非常感谢！'
            , createdBy : adminUser
            , lastModifiedBy:adminUser
            , owner:ownerGD0020).addToContractDetails(
                new ContractDetail(serialNumber:'1', category : category12_032, discount : 0.625, specialDiscount: 0.08, finalDiscount:0.575, expiryDate : new Date() + 180)
            ).addToContractDetails(
                new ContractDetail(serialNumber:'2', category : category12_001B, discount : 0.625, specialDiscount: 0.10, finalDiscount:0.5625, expiryDate : new Date() + 180)
            ).save(flush:true)

        def contractYX09G201108190042 = new Contract(
            serialNumber:'YX09G201108190042'
            , recordType:recordType22
            , subject : '东莞昊泰-雍景豪苑-非行业大客户申请表'
            , applicant:'刘华丽'
            , filingDate : new Date()
            , effectiveDate:new Date() + 1
            , dealer : dealerGD0020
            , project : '雍景豪苑'
            , industry : channelGK0001
            , description : '雍景地产是东莞区域重点房地产项目之一，其目前开发了雍景豪苑等住宅小区，并开始分批采购我司产品，预计采购量30万左右，现向公司申请5个大点的议价，请公司领导给予支持分盼，非常感谢！'
            , createdBy :adminUser 
            , lastModifiedBy:adminUser
            , owner:ownerGD0020)
            .addToContractDetails(
                new ContractDetail(serialNumber:'1', category : category12_031, discount : 0.625, specialDiscount: 0.10, finalDiscount:0.5625, expiryDate : new Date() + 180)
            ).addToContractDetails(
                new ContractDetail(serialNumber:'2', category : category12_001B, discount : 0.625, specialDiscount: 0.08, finalDiscount:0.575, expiryDate : new Date() + 180)
            ).save(flush:true)

        def contractYX09G201108190043 = new Contract(
            serialNumber:'YX09G201108190043'
            , recordType:recordType21
            , subject : '东莞昊泰-雍景豪苑-行业大客户申请表'
            , applicant:'刘华丽'
            , filingDate : new Date()
            , effectiveDate:new Date() + 1
            , dealer : dealerGD0020
            , project : '雍景豪苑'
            , industry : channelGK0001
            , description : '雍景地产是东莞区域重点房地产项目之一，其目前开发了雍景豪苑等住宅小区，并开始分批采购我司产品，预计采购量30万左右，现向公司申请5个大点的议价，请公司领导给予支持分盼，非常感谢！'
            , createdBy : adminUser
            , lastModifiedBy:adminUser
            , owner:ownerGD0020).addToContractDetails(
                new ContractDetail(serialNumber:'1', category : category12_031, discount : 0.60, specialDiscount: 0.2, finalDiscount:0.48, expiryDate : new Date() + 180)
            ).addToContractDetails(
                new ContractDetail(serialNumber:'2', category : category12_001B, discount : 0.60, specialDiscount: 0.01, finalDiscount:0.594, expiryDate : new Date() + 180)
            ).save(flush:true)
 
        
    }

    def destroy = {
    }
}
